﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _1010PhotoManagement
{
    public class PictManClass
    {
        public List<PictBaseClass> pictList = new List<PictBaseClass>();//照片对象列表

        public void AddPict(PictBaseClass _pbc)//增加照片对象
        {
            pictList.Add(_pbc);
        }
        public bool DeletePict(int index)//根据索引删除照片
        {
            if (index >= 0 && index < pictList.Count)
            {
                pictList.RemoveAt(index); return true;
            }
            else
                return false;
        }
        public bool ModiFyPict(int index, PictBaseClass _pbc)//根据索引修改照片信息
        {
            if (index >= 0 && index < pictList.Count)
            {
                pictList[index].PictDate = _pbc.PictDate;
                pictList[index].PictIntro = _pbc.PictIntro;
                pictList[index].PictName = _pbc.PictName;
                pictList[index].PictPath = _pbc.PictPath;
                return true;
            }
            else
                return false;
        }
        public PictBaseClass GetPict(int index)//根据索引返回一个照片对象
        {
            return pictList[index];
        }
    }
}
